<html>
    <head>
        <link rel="stylesheet" type="text/css" href="/css/addDocs.css" />
        <script src="/lib/js/jquery.min.js"></script>
        <script src="/lib/js/marked.min.js"></script>
        <link href="/lib/css/monokai-sublime.min.css"  rel="stylesheet" />
        <link href="/lib/pnotify/pnotify.custom.min.css"  rel="stylesheet" />
        <link href="/lib/bootstrap/bootstrap.css"  rel="stylesheet" />
        <script src="/lib/pnotify/pnotify.custom.min.js"></script>
        <link href="/lib/loading/css/loading.css"  rel="stylesheet" />
        <script src="/lib/loading/js/loading.js"></script>
        <script src="/lib/js/highlight.min.js"></script>
        <script src="/js/util.js"></script>
    </head>
    <body>
        <div class="addDocsBox">
            <div class="addDocsTitle"><i class="fa fa-file-text-o fa-lg"></i>新增接口文档分类<a href="/index"><span><i class="fa fa-mail-reply-all  fa-lg"></i>返回首页</span></a></div>
            <div class="addDocsContent">
                
                <div class="addDocsContentItem">
                    <div class="addDocsContentItemLeft">分类名称：</div>
                    <div class="addDocsContentItemRight"><input placeholder="请输入接口名称" class="docs_input" id="dc_name" /></div>
                </div>
                <div class="addDocsContentItem" style="margin-top:40px;">
                        <div class="addDocsContentItemLeft"></div>
                        <div class="addDocsContentItemRight">
                            <div class="addDocsContentItemSubmit">新增文档分类</div>
                        </div>
                    </div>
            </div>
        </div>
    </body>
    <script>
        $(function(){


            //提交新增操作
            $(".addDocsContentItemSubmit").click(function(){

                var dc_name = $("#dc_name").val();


                if(dc_name.length <= 0){
                    POP.warning("分类名称不能为空")
                    return;
                }

                var params = {
                    dc_name   : dc_name
                }

                POP.startLoading();

                HTTP.post("/docs/addCategory", params, (rs) => {

                    POP.endLoading();
                    POP.success("提示信息", "恭喜您，分类新增成功");

                    setTimeout(() => {
                        location.reload();
                    }, 1500);

                })
                
            });
        })
    </script>
</html>